﻿using Furion.RemoteRequest;
using SendOutExample.Application.System.Dtos;
using SendOutExample.Application.System.Remote;
using static System.Net.WebRequestMethods;

namespace SendOutExample.Application
{
    /// <summary>
    /// 系统服务接口
    /// </summary>
    public class SystemAppService : IDynamicApiController
    {
        private readonly ISystemService _systemService;
        private readonly IHttp _http;
        public SystemAppService(ISystemService systemService, IHttp http)
        {
            _http=http;
            _systemService = systemService;
        }

        /// <summary>
        /// 获取系统描述
        /// </summary>
        /// <returns></returns>
        public string GetDescription()
        {
            return _systemService.GetDescription();
        }
        /// <summary>
        /// 限制大小为250kb
        /// </summary>
        /// <returns></returns>
        [RequestSizeLimit(256000)]
        public async Task<object> PostQtxAbalysis([Required] IFormFile file)
        {

            HttpFile files = HttpFile.Create("asdadsa", file.ToByteArray(), "1.txt");

            RemoteDto dto = new RemoteDto() { id = 2/*, files = httpFile*/ };
            var data = await _http.PostRemote(dto, files);
            var result = await data.Content.ReadAsStringAsync();
            return null;
        }
    }
}